package min.chapter.five;
import  java.util.Locale;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//6. 메시지처리 124
public class MessageSourceAcquisition {
	public  static  void main(String[]  args)  {
		String[] configLocations = new String[] {"min/chapter/five/MessageSource.xml"};
		AbstractApplicationContext context = new ClassPathXmlApplicationContext(configLocations);
	
		context.registerShutdownHook();
		Locale  locale =  Locale.getDefault();
		String  greeting =  context.getMessage("greeting", new Object[0],  locale);
		System.out.println("Default  Locale Greeting:  " +  greeting);
		Locale  englishLocale =  Locale.ENGLISH;
		String englishGreeting = context.getMessage("greeting", new Object[0], englishLocale);
		
		System.out.println("English  Locale Greeting:  " +  englishGreeting);
	}
}
